﻿using System.Collections.Generic;
using System.Runtime.Remoting;

namespace TfsWrapper.OperationModes
{
    internal class ClientOperationMode : OperationMode
    {
        public ClientOperationMode() : base("client")
        {
        }

        public override void Execute(IEnumerable<string> args)
        {
            try
            {
                Remoting.Client.Execute(args);
            }
            catch (RemotingException)
            {
                Remoting.Client.StartServerProcess();
                Standalone.Execute(args);
            }
        }
    }
}